package data;

import java.util.Date;

import com.EntityName;
import com.google.appengine.api.datastore.Entity;

public class HoardingData extends AbstractData {
	private transient long counterId;
	private Date time;
	private String room;
	private Double amount;

	public long getCounterId() {
		return counterId;
	}
	public void setCounterId(long counterId) {
		this.counterId = counterId;
	}
	public Date getTime() {
		return time;
	}
	public void setTime(Date time) {
		this.time = time;
	}
	public String getRoom() {
		return room;
	}
	public void setRoom(String room) {
		this.room = room;
	}
	public Double getAmount() {
		return amount;
	}
	public void setAmount(Double amount) {
		this.amount = amount;
	}

	@Override
	public Entity getEntity() {
		Entity item = new Entity(EntityName.Hoarding);
		item.setProperty("time", this.time);
		item.setProperty("room", this.room);
		item.setProperty("amount", this.amount);
		return item;
	}
	@Override
	public void setEntity(Entity entity) {
		this.time = (Date) entity.getProperty("time");
		this.room = (String) entity.getProperty("room");
		this.amount = (Double) entity.getProperty("amount");
	}
}
